import java.util.Scanner;
public class Task15 {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		sc.close();
		
		while(n > 0){
			System.out.print(n % 10 + " ");
			n = n/10;
		}
		
	}

}
